import React from 'react'
import { Outlet , useNavigate } from 'react-router-dom'

export default function Home() {
  const navigate = useNavigate()

  //点击跳到音乐界面
  const toMusicHandle = () => {
    navigate("/main/home/music/?name=韩立&age=14300")
  }

  //点击跳到新闻界面
  const toNewsHandle = () => {
    navigate("/main/home/news/?name=厉飞雨&age=18")
  }

  return (
    <div>
      <h3>home</h3>
      <button onClick={toMusicHandle}>music</button>
      <button onClick={toNewsHandle}>news</button>
      <Outlet />
    </div>
  )
}
